/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package questionbook.service;

import java.util.List;
import questionbook.exception.IndividualAlreadyExistsException;
import questionbook.model.Answer;
import questionbook.model.Person;
import questionbook.model.Question;
import questionbook.service.common.GenericService;

/**
 * This Service holds all Methods for all CRUD-Operations
 * that belong to the Answer-Model
 *
 * @author stefanstift
 */
public interface AnswerService extends GenericService {

    /**
     *
     * @return an Answer Object with an generated URI, ready to use and to persist
     * @throws IndividualAlreadyExistsException
     */
    public Answer getIdentifiedAnswer() throws IndividualAlreadyExistsException;

    /**
     * Get all Answers for a specific Question
     *
     * @param q the specified Question
     * @return the List of Answers for the Question
     */
    public List<Answer> getByQuestion(Question q);

    /**
     *
     * @param p the specified Person
     * @return all Answers that a Person has given
     */
    public List<Answer> getByPerson(Person p);

    /**
     * Loads the AnserType for a specified Answer
     *
     * @param question the Question for which the answer was given
     * @param answer the answer for which the AnswerType gets loaded
     */
    public void loadAnswerType(Question question, Answer answer);

    /**
     * Saves an Answer for a specified Question
     *
     * @param a the new Answer that gets stored
     * @param q the Question for which the Answer was given
     */
    public void answer(Answer a, Question q);

    /**
     * Deletes the specified Answer from the Store
     *
     * @param a the Answer that gets deleted
     */
    public void delete(Answer a);

    /**
     * Removes the AnswerClass for the specified Answer
     *
     * @param a the Answer for which the AnswerClass is removed
     */
    public void removeClassification(Answer a);
    
    /**
     * Updates the AnswerClass for the specified Answer
     *
     * @param a The Answer which gets the updated AnswerClass
     */
    public void updateClassification(Answer a);

 

}
